home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2010 Summer - Disc 1
/
WN_Ete2010_CD1.iso
/
Onglet5
/
Weezo
/
Weezo setup.exe
/
{code_appDir}
/
www
/
js
/
mCommon.js
< prev
next >
Wrap
Text File
|
2010-05-19
|
6KB
|
1 lines
var D=document,W=window,rdgnl;var icoLoad="/themes/mobile/loading.gif",icoGo="/themes/mobile/go.gif",iTmp=new Image();iTmp.src=icoLoad;function dgi(a){return D.getElementById(a)}function rdgn(b,d,c){var e;var a;for(a=0;a<b.childNodes.length;a++){e=b.childNodes[a];if(e.tagName){if(c=="name"&&e.name==d){rdgnl[rdgnl.length]=e}if(c=="tag"&&e.tagName==d){rdgnl[rdgnl.length]=e}if(e.childNodes.length){rdgn(e,d,c)}}}}function dgn(a,b){if(!D.getElementsByName){rdgnl=new Array();rdgn(D.body,a,"name");if(!rdgnl.length){return}if(b=="all"){return rdgnl}if(b==undefined||isNaN(b)){b=0}return rdgnl[b]}if(!D.getElementsByName(a).length){return}if(b=="all"){return D.getElementsByName(a)}if(b==undefined||isNaN(b)){b=0}return D.getElementsByName(a)[b]}function dgtn(b,a){if(((a)?a:D).getElementsByTagName){return((a)?a:D).getElementsByTagName(b)}rdgnl=new Array();rdgn((a)?a:D,b.toUpperCase(),"tag");return rdgnl}function maskShow(a){}function maskHide(){}var mcRIP=0;var rqAbt=0;var mcRM="GET";var XHR;function sendData(g,b,a){if(mcRIP&&!a){return false}if(!b){b=""+D.location}if(W.resId){g+="&resId="+resId}g+="&asyncRequest=1";g=g.replace(/\+/g,"$weezoPlus$");if(g.substr(0,1)=="&"){g=g.substr(1)}XHR=false;if(dgi("ajaxIFrameForm")){XHR=new XMLHttpScriptRequest()}else{if(W.XMLHttpRequest){XHR=new XMLHttpRequest()}else{try{XHR=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Ajax not supported")}}}}if(mcRM="GET"&&g.length<1950){if(b.indexOf("?")!=-1){XHR.open("GET",b+"&"+g,true)}else{XHR.open("GET",b+"?"+g,true)}}else{XHR.open("POST",b,true)}XHR.onreadystatechange=function(){if(XHR.readyState==4){try{mcReqResp(XHR)}catch(d){}}return};mcRIP=true;rqAbt=0;if(mcRM=="POST"||g.length>=1950||dgi("ajaxIFrameForm")){XHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");XHR.send(g)}else{XHR.send(null)}return 1}function cancelSendData(){rqAbt=1;XHR.abort()}function mcReqResp(xhr){var gB="";mcRIP=false;if(!xhr){return}try{xhr.status}catch(e){return}if(rqAbt){return}if(xhr.status!=200){return false}if(xhr.responseText.length==0){return}var xmlRoot;var action;var content;if(!xhr.responseXML||(xmlRoot=xhr.responseXML.documentElement)==null){if(xhr.responseText.length>1000){return alert(xhr.responseText.substring(0,1000)+" ... "+xhr.responseText.substr(xhr.responseText.length-100))}return alert("XML error: "+xhr.responseText)}if(W.mcDbg&&mcDbg){alert(xhr.responseText)}for(var i=0;i<xmlRoot.childNodes.length;i++){n=xmlRoot.childNodes[i];if(n.nodeType!=1){continue}if(n.firstChild){content=n.firstChild.nodeValue}else{content=""}act=n.nodeName;if(act=="JSAction"){eval(content)}if(act=="innerHTML"){ni=n.getAttribute("nodeId");if(ni){dgi(ni).innerHTML=((n.getAttribute("add"))?dgi(ni).innerHTML:"")+content}}}}function asyncSubmit(a){var b=D.comForm;data="";for(var c=1;c<6;c++){if(b["data"+c].value.length>0){data+=((c>1)?"&":"")+"data"+c+"="+encodeURIComponent(b["data"+c].value)}}return sendData(data,b.action)}function fas(g,f,k,j,h){fillAndSubmit(g,f,k,j,h)}function asyncSubmitForm(f,a){if(!dgi(f)){return false}var d=dgi(f);var b;data="";var c=dgtn("input",d);for(var e=0;e<c.length;e++){b=c[e];if(b.name.length){if((b.type!="radio"&&b.type!="checkbox")||b.checked){if(data.length>0){data+="&"}data+=b.name+"="+encodeURIComponent(b.value)}}}c=dgtn("select",d);for(var e=0;e<c.length;e++){b=c[e];if(data.length>0){data+="&"}data+=b.name+"="+encodeURIComponent(b.value)}return sendData(data,d.action,a)}function XMLHttpScriptRequest(){this.action=false}XMLHttpScriptRequest.prototype.open=function(a,b){this.action=b};XMLHttpScriptRequest.prototype.setRequestHeader=function(){};XMLHttpScriptRequest.prototype.send=function(a){dgi("ajaxIFrameForm").action=this.action;dgn("XMLHttpScriptRequest").value=a+"&XMLHttpScriptRequest="+Math.random();dgi("ajaxIFrameForm").submit();return};function asEval(js){eval(js)}function ping(a){sendData("rnd="+Math.random(),"/ping.php",true);if(a){setTimeout("ping("+a+")",a)}}function mwJSLib(){this.liSel=function(n){if(typeof n=="string"){n=dgi(n)}if(!n){return}if(n.tagName=="TR"){n.className="liSel"}if(n.tagName=="TD"){n.parentNode.className="liSel"}if(n.className=="sli"){n.className="sliSel"}if(n.className=="frame2"){n.className="frame2Sel"}if(n.className=="bt"){n.className="btSel"}try{n.childNodes[2].childNodes[0].src=icoLoad}catch(e){}if(!this.liMonI){this.liMonI=setInterval("mwl.liMon()",400)}};this.liUnsel=function(n){if(typeof n=="string"){n=dgi(n)}if(n.tagName=="TR"){n.className="li"}if(n.tagName=="TD"){n.parentNode.className="li"}if(n.className=="sliSel"){n.className="sli"}if(n.className=="frame2Sel"){n.className="frame2"}if(n.className=="btSel"){n.className="bt"}try{n.childNodes[2].childNodes[0].src=icoGo}catch(e){}};this.liUnselAll=function(){var e,el=D.getElementsByTagName("TR");for(e in el){if(el[e]&&el[e].className=="liSel"){mwl.liUnsel(el[e])}}};this.liBlink=function(n){if(!n){return}mwl.liSel(n);if(!n.id){n.id="B"+Math.random()}setTimeout('mwl.liUnsel("'+n.id+'")',500)};this.liMonTS=(new Date()).getTime();this.liMon=function(){var p=mwl.liMonTS;mwl.liMonTS=(new Date()).getTime();if(mwl.liMonTS-p>2000){mwl.liUnselAll()}};this.liGrSel=function(n){elts=document.getElementsByTagName(n.tagName);nn=n.getAttribute("name");for(i=0;i<elts.length;i++){elt=elts[i];try{en=elt.getAttribute("name");if(en==nn){if(elt==n){this.liSel(n)}else{this.liUnsel(elt)}}}catch(e){}}};this.toMenu=function(){D.location="/index.php"};this.TCHide=function(){dgi("winBar").style.display="none"};this.TCShow=function(){dgi("winBar").style.display=""};this.TCToggle=function(){with(dgi("winBar").style){display=(display=="")?"none":""}}}var mwl=new mwJSLib();function us(a){if(dgi(a)){mwl.liUnsel(dgi(a))}};